package EvaTCPL;

public class EvaTCPLrndint extends EvaTCPLaexpression
{

  public EvaTCPLrndint(EvaTCPLaexpression e1, EvaTCPLaexpression e2)
    {
      super(e1,e2);
    }

  /** Evaluate this arithmetic expression. */
  public double evaluate()
    {
      int s0, s1;
      s0 = (int)sons[0].evaluate();
      s1 = (int)sons[1].evaluate();

      return  (((int)Math.rint((s1-s0)*Math.random()))%(s1-s0))+s0;
    }

  public String toString()
    {
      return "rndint("+sons[0].toString()+", "+sons[1].toString()+")";
    }

}
